<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>导航栏</title>
    <style>
        body,div,ul,li {
            margin: 0;
            padding: 0;
        }
        #nav {
            width: 960px;
            height: 35px;
            background-color: #E7E7E7;
            margin: 0 auto;
            margin-top: 30px;
        }
        #nav ul {
            width: 960px;
            height: 35px;
        }
        #nav ul li {
            list-style: none;
            float: left;
            background-image: url("images/nav_back2.jpg");
            height: 35px;
            text-align: center;
            line-height: 35px;
        }
        #nav ul li a {
            display: block;
            height: 35px;
            float: left; /*IE*/
            padding: 0 10px;
            font-size: 14px;
            color: #8790A1;
            text-decoration: none;
        }
        #nav ul li a:hover {
            background-color: #85CE02;
            color: #FFFFFF;
            font-size: 16px;
        }
    </style>
</head>
<body>
    <div id="nav">
        <ul>
            <li><a href="#">阿里巴巴</a></li>
            <li><a href="#">腾讯</a></li>
            <li><a href="#">百度</a></li>
            <li><a href="#">小米</a></li>
            <li><a href="#">今日头条</a></li>
            <li><a href="#">微软</a></li>
        </ul>
    </div>
</body>
</html>